/*    */ package com.zimbra.cs.redolog.op;
/*    */ 
/*    */ import com.zimbra.cs.mailbox.Mailbox;
/*    */ import com.zimbra.cs.mailbox.MailboxManager;
/*    */ import com.zimbra.cs.mailbox.MailboxOperation;
/*    */ import com.zimbra.cs.redolog.RedoLogInput;
/*    */ import com.zimbra.cs.redolog.RedoLogOutput;
/*    */ import java.io.IOException;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class EditNote
/*    */   extends RedoableOp
/*    */ {
/*    */   private int mId;
/*    */   private String mContent;
/*    */   
/*    */   public EditNote()
/*    */   {
/* 37 */     super(MailboxOperation.EditNote);
/* 38 */     this.mId = 0;
/*    */   }
/*    */   
/*    */   public EditNote(int mailboxId, int id, String content) {
/* 42 */     this();
/* 43 */     setMailboxId(mailboxId);
/* 44 */     this.mId = id;
/* 45 */     this.mContent = (content != null ? content : "");
/*    */   }
/*    */   
/*    */   protected String getPrintableData() {
/* 49 */     StringBuffer sb = new StringBuffer("id=");
/* 50 */     sb.append(this.mId).append(", content=").append(this.mContent);
/* 51 */     return sb.toString();
/*    */   }
/*    */   
/*    */   protected void serializeData(RedoLogOutput out) throws IOException {
/* 55 */     out.writeInt(this.mId);
/* 56 */     out.writeUTF(this.mContent);
/*    */   }
/*    */   
/*    */   protected void deserializeData(RedoLogInput in) throws IOException {
/* 60 */     this.mId = in.readInt();
/* 61 */     this.mContent = in.readUTF();
/*    */   }
/*    */   
/*    */   public void redo() throws Exception {
/* 65 */     Mailbox mailbox = MailboxManager.getInstance().getMailboxById(getMailboxId());
/* 66 */     mailbox.editNote(getOperationContext(), this.mId, this.mContent);
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/redolog/op/EditNote.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */